{% extends 'layout.html' %}

{% block content %}

    <div style="margin: 20px">
        <h1>角色管理</h1>

        <a href="{% url "rbac:role_add" %}" class="btn  btn-success">添加</a>

        <table class="table table-bordered table-hover" style="margin-top: 5px">
            <thead>
            <tr>
                <th>序号</th>
                <th>名称</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for role in all_roles %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ role.name }}</td>
                    <td>
                        <a href="{% url 'rbac:role_edit' role.id %}"> <i class="fa fa-edit"></i> </a>
                        <a href="{% url 'rbac:role_del' role.id %}"> <i class="fa fa-trash-o"></i> </a>
                    </td>
                </tr>

            {% endfor %}

            </tbody>
        </table>
    </div>


{% endblock %}